use eagle::lexer::lexer::Lexer;
use eagle::parser::parser::Parser;
fn main() {
    let source = std::fs::read_to_string("resources/2-type.eg").unwrap();
    let mut lexer = Lexer::new(&source);
    let spanned_tokens = lexer.tokenize();
    for token in &spanned_tokens {
        println!("{:?}", token);
    }
    let mut parser = Parser::new(spanned_tokens);
    match parser.parse() {
        Ok(ast) => println!("{:#?}", ast),
        Err(e) => eprintln!("Parse error: {}", e),
    }
}
